package com.example.bookmanage.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI springBootOpenAPI() {
        OpenAPI openAPI = new OpenAPI();
        openAPI.info(new Info().title("Oj编程系统API接口文档")
                // 接口文档简介
                .description("基于springboot3前后端分离项目")
                // 接口文档版本
                .version("1.0版本")
                // 开发者联系方式
                .contact(new Contact().name("白开水不加冰")
                        .email("lyk2024999@163.com")));
        openAPI.externalDocs(new ExternalDocumentation()
                .description("SpringBoot3")
                .url(""));// 接口文档标题
        return openAPI;
    }
}
